#/bin/sh
{% for ip in groups[kafka_hosts] %}
{% if  ip  == inventory_hostname %}
sed -i "s/broker.id=0/broker.id={{ loop.index - 1 }}/g" {{install_dir}}/kafka_2.12-{{kafka_version}}/config/server.properties
sed -i "s/host_name:port/{{ hostname }}:9092/g" {{install_dir}}/kafka_2.12-{{kafka_version}}/config/server.properties
#echo {{ loop.index - 1 }} > {{install_dir}}/{{data_dir}}/myid
{% endif %}
{% endfor %}
